<?php $this->load->view('view_pageheader'); ?>
    <label class="content_linkBack"><?php echo anchor('con_users', '< Back') ?></label>
    <label class="content_this">| GROUP MANAGER</label>
    
    <style type="text/css">
    table.register {
        margin: auto;
        margin-top: 5px;
        border: #010101 solid 1px;
        border-left-style: none;
        border-right-style: none;
        text-align: center;
        padding: 5px 5px;
        
    }
    table.register th {
        color: #000;
        border: #ecebeb solid 1px;
    }
    table.register td {
        border: #ecebeb solid 1px;
    }
    table.register tr:hover {
        background-color: #ffcc99;
    }
    table.register tr td > a {
        cursor: pointer;
    }
</style>
<script type="text/javascript">
    function select_gperson_id() {
        chk_active.submit();
    }
</script>
<div style="border: red hidden 1px; width: 100%;">
    <table border="0" cellpadding="5" class="register">
        <tr style="text-align: right; background: #fff;">
            <td colspan="8">
                <form action="Group_person" id="chk_active" name="chk_active" method="post">
                    <label>เลือกรูปแบบการแสดง : </label>
                    <select id="select_type" name="select_type" onchange="select_gperson_id();">
                        <option value="-1">Choose...</option>
                        <option value="0">Non-Active</option>
                        <option value="1">Active</option>
                        <option value="2">Default</option>
                    </select>
                </form>
            </td>
            <td>
                <div align="right">
                <a href="Newgperson"><img src="../../images/new.png" /></a>
                </div>
            </td>
        </tr>
        <tr style="background-color: #fff">
            <th>ID</th>
            <th colspan="5" style="width: 450px">GROUPName</th>
            <th>ACTIVE</th>
            <th>EDIT</th>
            <th>DELETE</th>
        </tr>
       
            <?php foreach ($data as $show) { ?>
                <tr>
                    
                    <td><?php echo $show->gperson_id . "<br />"; ?></td>
                    <td colspan="5" style="width: 450px" ><?php echo $show->gperson_name . "<br />"; ?></td>
                    <td><div align="center">
                    <form action="Group_person" id="activegperson" name="activegperson" method="post"> 
                    <?
                    if(($show->active)!=1) {
                        echo '<input type="image" src="../../images/check_false.png" name="image" />';
                        echo '<input type="hidden" name="activegperson" value="' . $show->active.':'.$show->gperson_id . '" />';
                    } else {
                        echo '<input type="image" src="../../images/check_true.png" name="image" />';
                        echo '<input type="hidden" name="activegperson" value="' . $show->active.':'.$show->gperson_id . '" />';
                    } ?>
                    </form>
                    </div></td>
                    <td><div align="center">  
                    <form action="Editgpersonpage" id="editgperson" name="editgperson" method="post">
                    <?
                        echo '<input type="image" src="../../images/edit.png" name="image" />';
                        echo '<input type="hidden" name="editgperson" value="' .$show->gperson_id . '" />';
                    ?>
                    </form>
                    </div></td>
                    <td><div align="center">  
                    <form action="Group_person" id="deletegperson" name="deletegperson" method="post">
                    <?
                        echo '<input type="image" src="../../images/trash.png" name="image" />';
                        echo '<input type="hidden" name="deletegperson" value="' .$show->gperson_id . '" />';
                    ?>
                    </form>
                    </div></td>
                </tr>
            <?php } ?>
        
    </table>
</div>
<?php $this->load->view('view_pagefooter'); ?>
